package com.sq.partner.manager.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.sq.partner.manager.dao.IGatewayConfigDao;
import com.sq.partner.manager.mybatis.model.GatewayConfig;
import com.sq.partner.manager.service.IGatewayConfigService;
import com.sq.partner.manager.util.StrUtil;
@Service
public class GatewayConfigServiceImpl implements IGatewayConfigService {
   
	@Resource
	private IGatewayConfigDao gatewayConfigDao;
	@Override
	public List<GatewayConfig> queryConfigList(GatewayConfig gatewayConfig)
			throws Exception {
		if(gatewayConfig != null){
		    return gatewayConfigDao.getConfigList(gatewayConfig);
		}else{
			return null;
		}
	}

	@Override
	public GatewayConfig queryConfigByName(String configName) throws Exception {
		if(configName!=null&&!"".equals(configName)){
			return gatewayConfigDao.getConfigByName(configName);
		}else{
			return null;
		}
	}

	@Override
	public boolean saveConfig(GatewayConfig gatewayConfig) throws Exception {
		return gatewayConfigDao.addConfig(gatewayConfig);
	}

	@Override
	public boolean updateConfig(GatewayConfig gatewayConfig) throws Exception {
		return gatewayConfigDao.updateConfig(gatewayConfig);
	}

	@Override
	public boolean deleteConfig(String configName) throws Exception {
		return gatewayConfigDao.deleteConfig(configName);
	}

}
